package com.minimalist.common.entity.basic.po;

import com.mybatisflex.annotation.Table;
import com.minimalist.common.config.mybatis.InsertFullColumnHandler;
import com.minimalist.common.config.mybatis.UpdateFullColumnHandler;
import com.minimalist.common.config.mybatis.bo.BaseEntity;

import java.io.Serial;
import java.io.Serializable;

/**
 * 租户套餐表 实体类。
 *
 * @author 小太阳
 * @since 2024-10-18
 */
@Table(value = "m_tenant_package", onInsert = InsertFullColumnHandler.class, onUpdate = UpdateFullColumnHandler.class)
public class MTenantPackage extends BaseEntity implements Serializable{

    public MTenantPackage() {
    }

    public MTenantPackage(Long packageId, String packageName, Integer status, String remark) {
        this.packageId = packageId;
        this.packageName = packageName;
        this.status = status;
        this.remark = remark;
    }

    public Long getPackageId() {
        return packageId;
    }

    public void setPackageId(Long packageId) {
        this.packageId = packageId;
    }

    public String getPackageName() {
        return packageName;
    }

    public void setPackageName(String packageName) {
        this.packageName = packageName;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        MTenantPackage that = (MTenantPackage) o;
        if (packageId != null ? !packageId.equals(that.packageId) : that.packageId != null) return false;
        if (packageName != null ? !packageName.equals(that.packageName) : that.packageName != null) return false;
        if (status != null ? !status.equals(that.status) : that.status != null) return false;
        return remark != null ? remark.equals(that.remark) : that.remark == null;
    }

    @Override
    public int hashCode() {
        int result = packageId != null ? packageId.hashCode() : 0;
        result = 31 * result + (packageName != null ? packageName.hashCode() : 0);
        result = 31 * result + (status != null ? status.hashCode() : 0);
        result = 31 * result + (remark != null ? remark.hashCode() : 0);
        return result;
    }

    public static Builder builder() {
        return new Builder();
    }

    public static class Builder {
        private Long packageId;
        private String packageName;
        private Integer status;
        private String remark;

        Builder() {
        }

        public Builder packageId(Long packageId) {
            this.packageId = packageId;
            return this;
        }

        public Builder packageName(String packageName) {
            this.packageName = packageName;
            return this;
        }

        public Builder status(Integer status) {
            this.status = status;
            return this;
        }

        public Builder remark(String remark) {
            this.remark = remark;
            return this;
        }

        public MTenantPackage build() {
            return new MTenantPackage(packageId, packageName, status, remark);
        }
    }

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 套餐ID
     */
    private Long packageId;

    /**
     * 套餐名称
     */
    private String packageName;

    /**
     * 状态 0禁用 1正常
     */
    private Integer status;

    /**
     * 备注
     */
    private String remark;

}
